2026-09-27 · class-notes, networking, ipv4, subnetting, netmask, nat, troubleshooting
Full class notes for Networking for Sysadmins ch. 3: IPv4 addressing, subnets/netmasks, viewing config on Windows/Debian/FreeBSD, private addressing and NAT, and troubleshooting.
How these notes were made: the material supplied for this lesson was the chapter's own heading list — "IPv4 Addresses", "Special IPv4 Addresses", "The Localhost Address", "Subnets", and so on — with an explicit instruction to draft the content from general knowledge rather than a transcript. These notes follow that heading structure, but the explanations are written from general networking knowledge, not reproduced or paraphrased from Michael W. Lucas's actual book text, which was not supplied. Treat this as original coverage of the same topics, organised the way the book organises them — worth checking against your own copy of the chapter for Lucas's specific examples, wording, and any details particular to his presentation.
Class notes · Networking for System Administrators (2nd ed.), Michael W. Lucas · Chapter 3
Quick reference: the short version of this lesson lives in the Networking for Sysadmins resource sheets. This follows Chapter 2 (Ethernet) — Ethernet gets frames onto the local wire; this chapter is about the addressing layered on top of that, IPv4.
By the end of these notes you should be able to:
An IPv4 address is a 32-bit number, conventionally written as dotted
decimal notation: four numbers from 0–255, separated by periods — for
example 192.168.1.10. Each of those four numbers represents one octet
(8 bits), and together the four octets make up the full 32-bit address.
An IPv4 address by itself does not say which part identifies the network and which part identifies the host on that network — that division is supplied separately, by the subnet mask (Section 4).
Certain addresses and ranges are reserved for specific purposes rather than being assigned to ordinary hosts:
| Address / range | Purpose |
|---|---|
0.0.0.0 |
Represents "this network" or an unspecified address, depending on context |
255.255.255.255 |
The limited broadcast address — reaches every host on the local network segment |
127.0.0.0/8 |
Reserved for loopback (Section 3) |
169.254.0.0/16 |
APIPA/link-local addresses, self-assigned when DHCP fails |
10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 |
Private address ranges (Section 9) |
127.0.0.1 is the best-known loopback address — a way for a machine
to address itself over IP, without traffic ever leaving the machine or
touching a real network interface. In fact, the entire 127.0.0.0/8
range (127.0.0.1 through 127.255.255.254) is reserved for loopback use,
though 127.0.0.1 is the address almost universally used in practice.
Loopback is heavily used by services that run and communicate locally on
one machine — a database only accepting connections from 127.0.0.1, for
instance, is deliberately refusing any connection that did not originate on
that same machine.
A subnet is a logically distinct portion of a larger IP network. Rather than treating every device as part of one enormous flat address space, subnetting divides the address space into smaller segments — useful for separating traffic (a staff subnet vs a guest subnet), for limiting the size of broadcast domains, and for organising a network in a way that mirrors an organisation's actual structure.
A subnet mask (or netmask) marks which bits of an IP address belong
to the network portion and which belong to the host portion. It is
written either in the same dotted-decimal form as an IP address (e.g.
255.255.255.0) or as CIDR notation — a slash followed by the number of
network bits (e.g. /24).
| CIDR | Netmask | Host bits | Usable hosts |
|---|---|---|---|
| /8 | 255.0.0.0 | 24 | 16,777,214 |
| /16 | 255.255.0.0 | 16 | 65,534 |
| /24 | 255.255.255.0 | 8 | 254 |
| /25 | 255.255.255.128 | 7 | 126 |
| /26 | 255.255.255.192 | 6 | 62 |
| /27 | 255.255.255.224 | 5 | 30 |
| /28 | 255.255.255.240 | 4 | 14 |
| /30 | 255.255.255.252 | 2 | 2 |
The larger the CIDR number (more network bits), the fewer hosts a
subnet can hold. A /24 (255.255.255.0) is a very common size for a small
office LAN, giving 254 usable host addresses.
Within any subnet, two addresses cannot be assigned to a host:
192.168.1.0/24, that is
192.168.1.0.192.168.1.0/24, that
is 192.168.1.255.That is why a /24 subnet, with 256 total addresses, yields only 254
usable host addresses — the first and last are reserved.
192.168.1.0/24:
192.168.1.0 <- network address (unusable)
192.168.1.1 <- first usable host (often the gateway)
...
192.168.1.254 <- last usable host
192.168.1.255 <- broadcast address (unusable)
A router forwards traffic between different networks — it is the device that lets a packet leave the local subnet and reach somewhere else. When a host needs to send traffic to an address outside its own subnet, it sends that traffic to its default gateway: the router's IP address on the local subnet, configured on every host that needs to reach beyond its own network.
Without a correctly configured default gateway, a host can talk to other devices on its own subnet, but nothing beyond it.
It helps to keep two related ideas distinct:
The gateway is the specific device — a router's local interface — that bridges a host's LAN to everything beyond it. "The network" a host can reach is therefore its own LAN, plus whatever its gateway (and the routers beyond that) can forward traffic toward.
The command to check a machine's IP configuration differs by operating system.
ipconfig
For full detail, including DNS servers and adapter descriptions:
ipconfig /all
The modern tool is ip, from the iproute2 package:
ip addr show
or shortened:
ip a
The older ifconfig command (from the net-tools package) still works on
many systems, though it is considered legacy on modern Linux distributions:
ifconfig
FreeBSD uses ifconfig as its standard, current tool for viewing (and
configuring) interfaces — unlike on Linux, this is not a legacy command on
FreeBSD:
ifconfig
Note (beyond this lesson): on FreeBSD,
ifconfigwith no arguments lists every interface and its assigned addresses; a specific interface can be queried withifconfig <interface_name>(e.g.ifconfig em0).
A machine can have more than one network interface — for example, a server with both a wired Ethernet port and a separate management network port, or a router with an interface on each network it connects. A host with multiple interfaces, each potentially on a different subnet, is sometimes called multihomed.
Each interface typically gets its own IP address (and can have its own default gateway, though a host generally uses only one at a time for general-purpose routing).
IP aliasing is assigning more than one IP address to a single network interface. A single physical (or virtual) interface can therefore answer to several addresses at once — useful for hosting multiple services that each need their own IP, without needing a separate physical interface for each.
On Linux, this is done with the ip command, adding a further address to an
existing interface:
ip addr add 192.168.1.50/24 dev eth0
Note (beyond this lesson): older Linux tooling historically used a labelled sub-interface naming convention such as
eth0:0,eth0:1for aliases; moderniproute2-based tooling (as shown above) simply attaches multiple addresses to the same interface name without that labelling scheme.
Certain IPv4 ranges are set aside as private — not routable on the public internet, and free for any organisation to reuse internally without coordinating with anyone else. These are defined in RFC 1918:
| Range | CIDR |
|---|---|
10.0.0.0 – 10.255.255.255 |
10.0.0.0/8 |
172.16.0.0 – 172.31.255.255 |
172.16.0.0/12 |
192.168.0.0 – 192.168.255.255 |
192.168.0.0/16 |
Because private addresses cannot be routed on the public internet directly, a device called a NAT (Network Address Translation) gateway — typically built into a home or office router — translates between a host's private address and a single public address when traffic needs to leave the local network. This is what lets many devices on a private network share one public internet connection.
A laptop on a home network has the private address 192.168.1.20. It sends a
request to a public web server.
192.168.1.1.192.168.1.20 to the router's own public IP address before sending it
onward to the internet.192.168.1.20 before delivering it to the laptop.The laptop never has a directly internet-routable address of its own — NAT makes that unnecessary for outbound connections.
A basic, layered approach to IP-level troubleshooting:
In the real world: working through these steps in order — local config, then local subnet, then gateway, then beyond — narrows down where a connectivity problem actually lives far faster than guessing at the far end first.
IPv4 addressing and subnetting decisions carry real security weight, beyond pure connectivity:
127.0.0.1 cannot be reached from anywhere else on
the network at all — a genuinely strong restriction for anything that only
needs to be used locally (a local admin interface, a database only accessed
by an app on the same host).0.0.0.0, the broadcast 255.255.255.255, the
127.0.0.0/8 loopback range (usually 127.0.0.1), and the
169.254.0.0/16 APIPA/link-local range.ipconfig (Windows), ip addr show (modern
Debian/Linux, with legacy ifconfig still around), or ifconfig
(FreeBSD's standard tool).10.0.0.0/8, 172.16.0.0/12,
192.168.0.0/16) plus NAT lets many private hosts share one public
address.| Term | Meaning |
|---|---|
| IPv4 address | A 32-bit address in dotted-decimal form. |
| Octet | One of the four 8-bit segments of an IPv4 address. |
| Subnet mask / netmask | Defines the network vs host portion of an address. |
| CIDR notation | Slash notation stating the number of network bits (e.g. /24). |
| Loopback | 127.0.0.0/8; a host addressing itself, usually via 127.0.0.1. |
| Network address | The all-host-bits-zero address identifying a subnet. |
| Broadcast address | The all-host-bits-one address reaching every host on a subnet. |
| Default gateway | The router a host sends off-subnet traffic to. |
| LAN | The local segment directly reachable without routing. |
| Multihomed | A host with more than one network interface/address. |
| IP aliasing | Assigning multiple IP addresses to one interface. |
| RFC 1918 | The standard defining the private IPv4 address ranges. |
| NAT | Network Address Translation; maps private to public addresses. |
| APIPA / link-local | 169.254.0.0/16; self-assigned when DHCP fails. |
ipconfig (Windows); ip addr show (modern Debian/Linux, ifconfig
still exists as legacy); ifconfig (FreeBSD, still the standard tool
there). Three different platforms, three commands.